<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  function Cat(name, color) {
    this.name = name;
    this.color = color;
    // this.species = "cat";
    // this.call = function () {
    //   console.log("喵喵");
    // }
    // this.skill = function () {
    //   console.log("捉老鼠");
    // }
    // return this;
    // console.log(this, this instanceof Cat);

  }

  Cat.prototype.species = "cat";
  Cat.prototype.call = function () {
    console.log("喵喵");
  }
  Cat.prototype.skill = function () {
    console.log("捉老鼠");
  }

  Cat.prototype.say = function () {
    console.log(this.name, this.color);
  }

  console.dir(Cat.prototype);

  console.log(Cat);
  var Tom = new Cat("Tom", "black");
  console.log(Tom);

  // console.log(Tom.name, Tom.color);
  // console.log(Tom.species);
  // console.log(Tom.call);

  // Tom.call();
  // Tom.say();

  console.log(Tom.__proto__ === Cat.prototype);

  var bo = new Cat("bo", "pink");
  console.log(bo);
  // bo.say();
  // bo.call();
  // bo.skill();
  // console.log(bo.name, bo.color);
  // console.log(bo.call);
  // console.log(bo.species);

  console.log(bo.__proto__ === Cat.prototype);

  console.dir(Array);
  console.dir(String);


</script>

</html>